package com.cxm.qyyz.core;

import com.cxm.qyyz.core.db.DatabaseHelper;
import com.cxm.qyyz.core.http.BaseResponse;
import com.cxm.qyyz.core.http.HttpHelper;
import com.cxm.qyyz.entity.ServerUrlEntity;
import com.cxm.qyyz.entity.response.LoginEntity;

import io.reactivex.rxjava3.core.Observable;

public class DataManager implements HttpHelper, DatabaseHelper {

    private final HttpHelper httpHelper;

    public DataManager(HttpHelper httpHelper, DatabaseHelper databaseHelper) {
        this.httpHelper = httpHelper;
    }

    @Override
    public Observable<BaseResponse<LoginEntity>> loginByPwd(String account, String password) {
        return httpHelper.loginByPwd(account, password);
    }

    @Override
    public Observable<BaseResponse<ServerUrlEntity>> getServerUrl() {
        return httpHelper.getServerUrl();
    }
}
